package com.wswy.wzcx.model;

import com.google.gson.annotations.SerializedName;

/**
 * Created by wangduheng26 on 2018/1/29.
 * wangduheng26@gmail.com
 */

public class MessageMode {
    public static final String MESSAGE_SYSTEM = "system";
    public static final String MESSAGE_USER = "user";

    public static final String MESSAGE_SOCIAL = "active";

    @SerializedName("system")
    public MessageDetail systemMessage;
    @SerializedName("user")
    public MessageDetail userMessage;

    @SerializedName("active")
    public MessageDetail socialMessage;


    public int getMessageCount(){
      int count = 0;
      if (systemMessage != null){
        count += systemMessage.unreadTotal;
      }
      if (userMessage != null){
        count+=userMessage.unreadTotal;
      }
      if (socialMessage != null){
        count += socialMessage.unreadTotal;
      }
      return count;
    }

    public static int getTypeId(String type){
      int id = 0;
      switch (type){
        case MESSAGE_SYSTEM:
          id = 1005;
          break;
        case MESSAGE_USER:
          id = 1004;
          break;
        case MESSAGE_SOCIAL:
          id = 1006;
          break;
      }
      return id;
    }

}
